<?php

class JournalArticleTable extends Doctrine_Table
{
	public function getArticleJournal($id){
		
		$q=Doctrine_Query::create()
		  -> select('a.articleid as idart')
		  -> from('journalarticle as a')
		  -> where('a.journalid =?',$id);
		  
		return $q->execute();
	
	}
	
	public function delArticleJournal($id){
	
		$q=Doctrine_Query::create()
		  -> delete('a.articleid, a.journalid')
		  -> from('journalarticle as a')
		  -> where('a.journalid =?',$id);
		  
		  $q->execute();
	}
        public function updateOrder($idj, $idar, $order){
            $q=Doctrine_Query::create()
                    -> update('journalarticle')
                    -> set('ordre',  intval($order))
                    -> where('journalId =?', $idj)
                    -> andWhere('articleId=?', $idar);
            
            $q->execute();
        }
}